package com.juice.actuator;

import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @desc:
 * @author: panxiyi
 * @date: 2023/5/14 3:46 下午
 */

@Component
public class HealthConfig extends AbstractHealthIndicator {
    @Override
    protected void doHealthCheck(Health.Builder builder) throws Exception {
        builder.withDetail("runTime", System.currentTimeMillis());
        Map infoMap =  new HashMap<>();
        infoMap.put("buildTime", 2006);
        infoMap.put("Tel", 17850396689L);
        builder.withDetails(infoMap);
        builder.status(Status.UP);
    }
}
